package com.gxufl.service;

import java.util.List;

import com.gxufl.dao.NoticeDao;
import com.gxufl.entity.Notice;

public class NoticeService {
	
	NoticeDao dao = new NoticeDao();
	
	public List<Notice> searchNotice() {
//		List<Notice> list = null;
		//从Dao层取List海报数据
		List<Notice> list = dao.findList(null,null);
		return list;
	}
	
	public List<Notice> searchNotice(String name, String showdate) {
		return dao.findList(name, showdate);
	}
	

	public void saveNotice(Notice notice) {
		dao.save(notice);
	}

	public void deleteNotice(String name) {
		dao.delete(name);
	}

	public Notice searchOneNotice(String noticename) {
		List<Notice> list = this.searchNotice(noticename, null);
		if(list.size() == 1) {
			return list.get(0);
		} else {
			System.out.println("错误，找到了"+list.size()+"个不同的电影");
		}
		return null;
	}

}
